/* GUI CONVERTED from rsrp07.p (converter v1.75) Tue Nov  7 07:30:16 2000 */
/* rsrp07.p - Release Management Supplier Schedules                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*F0PN*/ /*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 7.3    LAST MODIFIED: 12/16/92           BY: WUG *G462*          */
/* REVISION: 7.3    LAST MODIFIED: 01/12/95           BY: srk *G0C1*          */
/* REVISION: 7.3    LAST MODIFIED: 11/06/96           BY: *G2HP* Suresh Nayak */
/* REVISION: 8.6    LAST MODIFIED: 10/09/97           BY: GYK *K0MT*          */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane            */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan           */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* myb                  */
/* REVISION: 9.1    LAST MODIFIED: 09/11/00   BY: *N0RT* Mudit Mehta          */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rsrp07_p_1 "Sort Option"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp07_p_2 "Start Date"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp07_p_3 "Per Column"
/* MaxLen: Comment: */

/*N0RT***********BEGIN COMMENTING*************
 * &SCOPED-DEFINE rsrp07_p_4 "2 - By Item, Ship-to, Supplier, PO"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rsrp07_p_5 "1 - By Ship-to, Supplier, Item, PO"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rsrp07_p_6 "3 - By PO, Item"
 * /* MaxLen: Comment: */
 *N0RT***********END COMMENTING************* */

&SCOPED-DEFINE rsrp07_p_7 "Day/Week/Month"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* RECEIVING SUMMARY REPORT */

         define new shared variable supplier_from like po_vend.
         define new shared variable supplier_to like po_vend.
         define new shared variable shipto_from like po_ship.
         define new shared variable shipto_to like po_ship.
         define new shared variable part_from like pod_part.
         define new shared variable part_to like pod_part.
         define new shared variable po_from like po_nbr.
         define new shared variable po_to like po_nbr.
         define new shared variable buyer_from like po_buyer.
         define new shared variable buyer_to like po_buyer.
         define new shared variable sortoption as integer label {&rsrp07_p_1}
                                                 format "9" initial 1.
/*N0RT*
 *          define new shared variable sortextoption as character extent 3 format "x(34)"
 *   initial [
 *   {&rsrp07_p_5},
 *   {&rsrp07_p_4},
 *   {&rsrp07_p_6}].
 *N0RT*/
/*N0RT*/ define new shared variable sortextoption as character extent 3 format "x(34)".

         define new shared variable start as date label {&rsrp07_p_2}.
         define new shared variable sdate as date extent 14.
         define new shared variable interval as integer extent 14.
         define new shared variable dwm as character format "x(1)"
                     label {&rsrp07_p_7}.
         define new shared variable idays as integer format ">9" label {&rsrp07_p_3}.

         define variable monthend as integer.
         define new shared variable num_intervals as integer initial 13.
         define variable i as integer.

/*N0RT************* SET INITIAL VALUSES ************* */
/*N0RT*/ sortextoption[1] = "1 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("SHIP-TO",7) + ", " +
                             getTermLabel("SUPPLIER",8) + ", " +
                             getTermLabel("ITEM",4) + ", " +
                             getTermLabel("PURCHASE_ORDER",2).
/*N0RT*/ sortextoption[2] = "2 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("ITEM",4) + ", " +
                             getTermLabel("SHIP-TO",7) + ", " +
                             getTermLabel("SUPPLIER",8) + ", " +
                             getTermLabel("PURCHASE_ORDER",2).
/*N0RT*/ sortextoption[3] = "3 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("PURCHASE_ORDER",2) + ", " +
                             getTermLabel("ITEM",4).
         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
po_from              colon 20
            po_to                colon 50 label {t001.i}
            part_from            colon 20
            part_to              colon 50 label {t001.i}
            supplier_from        colon 20
            supplier_to          colon 50 label {t001.i}
            shipto_from          colon 20
            shipto_to            colon 50 label {t001.i}
            buyer_from           colon 20
            buyer_to             colon 50 label {t001.i}
            skip(1)
            start          colon 26
            dwm            colon 26
            idays      colon 26
            sortoption           colon 26
            sortextoption[1]     at 35 no-label
            sortextoption[2]     at 35 no-label
            sortextoption[3]     at 35 no-label
            skip(1)
          SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

         start = today.
         dwm = "D".
         idays = 1.

/*G0C1*  repeat with frame a: */
/*K0MT*/ {wbrp01.i}

/*G0C1*/ 
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*K0MT*
 *             disp sortextoption
 * /*G0C1*/     with frame a.
*K0MT*/

/*K0MT*/    display sortextoption
/*G0C1*/    with frame a.

            if po_to = hi_char then po_to = "".
            if part_to = hi_char then part_to = "".
            if supplier_to = hi_char then supplier_to = "".
            if shipto_to = hi_char then shipto_to = "".
            if buyer_to = hi_char then buyer_to = "".

/*K0MT*/    if c-application-mode <> 'web' then
            
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0MT*/    {wbrp06.i &command = update
                      &fields = "  po_from po_to part_from part_to
                       supplier_from supplier_to shipto_from shipto_to
                       buyer_from buyer_to start dwm idays sortoption "
                      &frm = "a"}

/*K0MT*/    if (c-application-mode <> 'web') or
/*K0MT*/       (c-application-mode = 'web' and
/*K0MT*/       (c-web-request begins 'data'))
            then do:

               bcdparm = "".
               {mfquoter.i po_from     }
               {mfquoter.i po_to       }
               {mfquoter.i part_from   }
               {mfquoter.i part_to     }
               {mfquoter.i supplier_from}
               {mfquoter.i supplier_to }
               {mfquoter.i shipto_from }
               {mfquoter.i shipto_to   }
               {mfquoter.i buyer_from  }
               {mfquoter.i buyer_to    }
               {mfquoter.i start       }
               {mfquoter.i dwm         }
               {mfquoter.i idays       }
               {mfquoter.i sortoption  }

               if po_to = "" then po_to = hi_char.
               if part_to = "" then part_to = hi_char.
               if supplier_to = "" then supplier_to = hi_char.
               if shipto_to = "" then shipto_to = hi_char.
               if buyer_to = "" then buyer_to = hi_char.

               sdate[1] = today.
               {mfcsdate.i}
/*G2HP*        sdate[1] = 01/01/1900.        */
/*G2HP*/       sdate[1] = low_date.

/*K0MT*/    end.

            /* SELECT PRINTER */
            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




            {mfphead.i}

            if sortoption = 1 then do:
               {gprun.i ""rsrp07a.p""}
            end.
            else
            if sortoption = 2 then do:
               {gprun.i ""rsrp07b.p""}
            end.
            else
            if sortoption = 3 then do:
               {gprun.i ""rsrp07c.p""}
            end.

            /* REPORT TRAILER */
            
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


         end.

/*K0MT*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" po_from po_to part_from part_to supplier_from supplier_to shipto_from shipto_to buyer_from buyer_to start dwm idays sortoption  "} /*Drive the Report*/
